package cn.zhuo.knowledge.util.lombok.construct;

import lombok.AllArgsConstructor;

import java.util.List;

/**
 * <p>
 *
 * @author z2huo
 */
@AllArgsConstructor
class AllArgsConstructorTest {

    private String field;

    private Integer field2;

    // @AllArgsConstructor 注解所创建的全参构造器参数位置是根据字段在类中的位置决定的
//    private int[] array;

    private List<String> list;

    public static void main(String[] args) {
        new AllArgsConstructorTest("asdfa", 12, List.of("1", "2"));
    }

}

/*

使用 @AllArgsConstructor 注解

public class AllArgsConstructorTest {

    private String field;
    private Integer field2;
    private List<String> list;

    public static void main(String[] args) {
        new AllArgsConstructorTest("asdfa", 12, List.of("1", "2"));
    }

    public AllArgsConstructorTest(String field, Integer field2, List<String> list) {
        this.field = field;
        this.field2 = field2;
        this.list = list;
    }
}

 */